import request from '@/utils/request'

// 查询列表
export function listCertificate(data) {
	const { pageNum, pageSize } = data
	let postdata = { ...data }
	delete postdata.pageNum
	delete postdata.pageSize
	return request({
		url: '/refuge/list' + `?pageNum=${pageNum}&pageSize=${pageSize}`,
		method: 'post',
		data: postdata
	})
}

// 查询详细
export function getShelterDetail(menuId) {
	return request({
		url: '/refuge/' + menuId,
		method: 'get'
	})
}

// 新增
export function addShelter(data) {
	return request({
		url: '/refuge',
		method: 'post',
		data: data
	})
}

// 修改
export function updateShelter(data) {
	return request({
		url: '/refuge',
		method: 'put',
		data: data
	})
}


// 删除
export function delShelter(menuId) {
	return request({
		url: '/refuge/' + menuId,
		method: 'delete'
	})
}


// 获取省市区JSON
export function getAreaJson() {
	return request({
		url: '/chinaArea/areaMap',
		method: 'get'
	})
}

// 获取经纬度
export function getLnglat(data) {
	return request({
		url: '/addressToMap/addressMap',
		method: 'post',
		data: data
	})
}

// 查询省市区
export function getCity() {
	return request({
		url: '/chinaArea/list',
		method: 'get'
	})
}